﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Polendamus.Models.PolenModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Polendamus: Tú oráculo del polen
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% using (Html.BeginForm())
       {%>
    <%if (ViewData["MessageWarning"] != null)
      { %>
    <h2>
        <%: ViewData["MessageWarning"]%></h2>
    <%} %>
    <script type="text/javascript" src="Scripts/jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        // Change the image of hoverable images
        $(".imgHoverable").hover(function () {
            var hoverImg = HoverImgOf($(this).attr("src"));
            $(this).attr("src", hoverImg);
        }, function () {
            var normalImg = NormalImgOf($(this).attr("src"));
            $(this).attr("src", normalImg);
        }
   );
    });

    function HoverImgOf(filename) {
        var re = new RegExp("(.+)\\.(gif|png|jpg)", "g");
        return filename.replace(re, "$1_hover.$2");
    }
    function NormalImgOf(filename) {
        var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
        return filename.replace(re, "$1.$2");
    }
</script>
    <table width="100%">
        <tr>
            <td width="10%">
                <img src="/Content/Images/<%:ViewData["ImgPersona1"] %>" alt="hom1" />
            </td>
            <td style="background-image: url('/Content/Images/bocadillo 2 alargado.png'); text-align: center;
                font-family: Comic Sans MS; font-size: medium; background-repeat: no-repeat;"
                width="400px" height="250px">
                <%:Html.Label(Model.Bocadillo1) %>
            </td>
            <td width="20%">
            </td>
        </tr>
    </table>
    <table width="100%">
        <tr>
            <td width="35%">
                <table>
                    <tr>
                        <td>
                            Provincias:
                        </td>
                        <td>
                            <%  List<Polendamus.Provincias> provincias = (List<Polendamus.Provincias>)ViewData["Provincias"];%>
                            <%: Html.DropDownListFor(model=>model.Provincia, new SelectList(provincias, "Nombre", "Nombre"), new { style = "width:200px;height:25px; font-size:small" })%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Tipos de Alergias:
                        </td>
                        <td>
                            <%  List<Polendamus.Alergias> alergias = (List<Polendamus.Alergias>)ViewData["Alergias"];%>
                            <%: Html.DropDownListFor(model=>model.Alergia, new SelectList(alergias, "Nombre", "Nombre"),new { style = "width:200px;height:25px; font-size:small" })%>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input id="boton" type="image" class="imgHoverable" src="../../Content/Images/buscar.png" />
                        </td>
                    </tr>
                </table>
            </td>
            <td style="background-image: url('/Content/Images/bocadillo 1 alargado.png'); text-align: center;
                font-family: Comic Sans MS; font-size: medium; background-repeat: no-repeat;"
                width="400px" height="250px">
                <%:Html.Label(Model.Bocadillo2) %>
            </td>
            <td width="20%">
                <img src="/Content/Images/<%: ViewData["ImgPersona2"] %>" alt="hom1" />
            </td>
        </tr>
    </table>
    <%-- <table width="100%">
        <tr>
            <td width="10%">
            </td>
            <td style="background-image:url('/Content/Images/bocadillo 2.png'); font-family:Comic Sans MS; font-size:medium; background-repeat: no-repeat; text-align:center" width="400px" height="250px">
            <%:Html.Label(Model.Bocadillo1) %>
               
            </td>
            <td style="background-image:url('/Content/Images/bocadillo 1.png');font-family:Comic Sans MS; font-size:medium; background-repeat: no-repeat; text-align:center" width="400px"  height="250px" >
                <%:Html.Label(Model.Bocadillo2) %>
            </td>
            <td width="10%">
            </td>
        </tr>
        </table>--%>
    <%--<tr>
            <td>
                <img src="/Content/Images/polen medio 1 persona 1.png" alt="hom1" />
            </td>
            <td colspan="2" style="text-align: center">
                Provincias:
                <%  List<Polendamus.Provincias> provincias = (List<Polendamus.Provincias>)ViewData["Provincias"];%>
                <%: Html.DropDownListFor(model=>model.Provincia, new SelectList(provincias, "Nombre", "Nombre"), new { style = "width:200px;height:25px; font-size:small" })%>
                Tipos de Alergias:
                <%  List<Polendamus.Alergias> alergias = (List<Polendamus.Alergias>)ViewData["Alergias"];%>
                <%: Html.DropDownListFor(model=>model.Alergia, new SelectList(alergias, "Nombre", "Nombre"),new { style = "width:200px;height:25px; font-size:small" })%>
                <br />
                <br />
                <input type="submit" value="BUSCAR" />
            </td>
            <td style="text-align: right">
                <img src="/Content/Images/polen medio 1 persona 2.png" alt="hom2" />
            </td>
        </tr>
    </table>--%>
    <%} %>
</asp:Content>
